package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-01-31
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_cps_channel_info")
@ApiModel(value = "CpsChannelInfo", description = "")
@AllArgsConstructor
public class CpsChannelInfo extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 渠道ID
     */
    @ApiModelProperty(value = "渠道ID")
    @Length(max = 20, message = "渠道ID长度不能超过20")
    @TableField(value = "channel_id", condition = LIKE)
    @Excel(name = "渠道ID")
    private String channelId;

    /**
     * 渠道名称
     */
    @ApiModelProperty(value = "渠道名称")
    @Length(max = 255, message = "渠道名称长度不能超过255")
    @TableField(value = "channel_name", condition = LIKE)
    @Excel(name = "渠道名称")
    private String channelName;

    /**
     * 0失效 1 生效
     */
    @ApiModelProperty(value = "0失效 1 生效")
    @TableField("status")
    @Excel(name = "0失效 1 生效")
    private Integer status;

    /**
     * 渠道商户号
     */
    @ApiModelProperty(value = "渠道商户号")
    @Length(max = 20, message = "渠道商户号长度不能超过20")
    @TableField(value = "channel_merch_id", condition = LIKE)
    @Excel(name = "渠道商户号")
    private String channelMerchId;

    /**
     * 渠道密钥
     */
    @ApiModelProperty(value = "渠道密钥")
    @Length(max = 2048, message = "渠道密钥长度不能超过2048")
    @TableField(value = "channel_merch_private_key", condition = LIKE)
    @Excel(name = "渠道密钥")
    private String channelMerchPrivateKey;


    @Builder
    public CpsChannelInfo(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    String channelId, String channelName, Integer status, String channelMerchId, String channelMerchPrivateKey) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.channelId = channelId;
        this.channelName = channelName;
        this.status = status;
        this.channelMerchId = channelMerchId;
        this.channelMerchPrivateKey = channelMerchPrivateKey;
    }

}
